<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{/common/header::header-head}">
</head>
<body>
<div th:replace="~{/common/header::header-body}"></div>

<div class="container mb-3 mt-3">
    <form th:action="@{'/back/article/publish/'+${article==null?'':article.getId()}}" method="post">
        <label for="title" class="form-label">标题</label>
        <input type="text" class="form-control" id="title" name="title" required th:value="${article==null?'':article.getTitle()}">

        <label for="category" class="form-label">分类</label>
        <input type="text" class="form-control" id="category" name="category" required th:value="${article==null?'':article.getCategory()}">

        <label for="comment" class="form-label">内容</label>
        <textarea class="form-control" rows="5" id="comment" name="content" required th:text="${article==null?'':article.getContent()}"></textarea>
        <button type="submit" class="btn btn-primary">发布</button>
    </form>
</div>

</body>
</html>